package com.mk.mapper;

import com.mk.base.mapper.BaseMapper;
import com.mk.model.entity.Resource;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @Author: yq
 * @Description:
 * @Date: Created in 4:15 PM 3/13/18
 */
@Repository
@Mapper
public interface ResourceMapper extends BaseMapper<Resource> {

    List<Resource> findByUsername(@Param("username") String username, @Param("isDeleted") Integer able);

    List<Resource> findByRoleId(@Param("roleId") Long roleId,@Param("isDeleted") Integer able);

    List<Resource> findByRoleCode(@Param("roleCode") String code,@Param("isDeleted") Integer able);

    List<String> findCodesByUsername(@Param("username") String username,@Param("isDeleted") Integer able);

    List<Resource> findByParentAndType(@Param("parentId") Long parentId,@Param("type") String type,@Param("isDeleted") Integer able);
}
